import request from '@/utils/request'

/**
 * @method 注册
 * @param {*} data
 * @returns
 */
export function register(data) {
  return request({
    baseURL: '/serv',
    url: '/auth/register',
    method: 'post',
    data
  })
}

/**
 * 获取验证码
 * @param phone
 * @returns {*}
 */
export function getSmsCode(phone) {
  return request({
    baseURL: '/serv',
    url: '/auth/sendVerCode',
    method: 'post',
    data: { username: phone }
  })
}

/**
 * 登录
 * @param data
 * @returns {*}
 */
export function login(data) {
  return request({
    baseURL: '/serv',
    url: '/auth/login',
    method: 'post',
    data
  })
}

/**
 * 登出
 * @returns {*}
 */
export function logout() {
  return request({
    baseURL: '/serv',
    url: '/auth/logout',
    method: 'post'
  })
}

/**
 * 获取用户信息
 * @returns {*}
 */
export function getUserInfo() {
  return request({
    baseURL: '/serv',
    url: '/api/getUserInfo',
    method: 'post'
  })
}

export function getActiveCode(data) {
  return request({
    baseURL: '/serv',
    url: '/api/getActiveCode',
    method: 'post',
    data
  })
}

export function sysActive(data) {
  return request({
    baseURL: '/serv',
    url: '/auth/activeUser',
    method: 'post',
    data
  })
}

export function sysBind(mall_boundle_list) {
  return request({
    baseURL: '/serv',
    url: '/api/bundleMall',
    method: 'post',
    data: { mall_boundle_list }
  })
}

export function sysNotice() {
  return request({
    baseURL: '/serv',
    url: '/notice/getNoticeInfos',
    method: 'post'
  })
}

export function sysNoticeDetail(notice_id) {
  return request({
    baseURL: '/serv',
    url: '/notice/getNotice',
    method: 'post',
    data: { notice_id }
  })
}

export function sysNoticeDialog() {
  return request({
    baseURL: '/serv',
    url: '/notice/getPopupNoticeInfos',
    method: 'post'
  })
}

export function sysNoticeDialogByIdc(id) {
  return request({
    baseURL: '/serv',
    url: '/notice/getPopupNoticeContent',
    method: 'post',
    data: { popupNoticeId: id }
  })
}

export function sysNoticeDialogNotTip(id) {
  return request({
    baseURL: '/serv',
    url: '/notice/setPopupNoticeNotPopup',
    method: 'post',
    data: { popupNoticeId: id }
  })
}

export function getVersion() {
  return request({
    url: '/api/getVersion',
    method: 'post'
  })
}
